import { get } from "../../utils/request"
import {post} from"../../utils/request"
const app=getApp()
// 登录的接口
export function logininfo(username,password){
  return post("/api/login",{
    username,
    password,
    rememberMe:false
  })
  
}
// 判断登录状态的接口
export function getUserInfo(){
 return get("/api/login-user/info").then(res=>{
  const app  = getApp();
  if(res.data.code == 0){ 
    app.globalData.isLogin = true;
    app.globalData.user = res.data.data
  }else{
    app.globalData.isLogin = false;
    app.globalData.user = null;
  }
  return res;
})
}